package dst1.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OrderColumn;
import javax.persistence.Table;

import dst1.listener.DefaultEntityListener;

@Entity
@Table(name="ENVIRONMENT")
public class Environment implements Serializable{

	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="ID") 
	private Long id;
	
	@Column(name="WORKFLOW") 
	private String workflow;
	
	//@ElementCollection(fetch=FetchType.EAGER)
	//@OrderBy("params ASC") 
	@ElementCollection(targetClass = java.lang.String.class) //sonst error
	@OrderColumn//(name = "PARAMS_ORDER", nullable = false) //Ordering is important
	@Column(name="PARAMS") 
	private List<String> params;
	
	public Environment(){
		
	}

	public Environment(String workflow, List<String> params) {
		super();
		this.workflow = workflow;
		this.params = params;
	}

	public Long getId() {
		return id;
	}

	public String getWorkflow() {
		return workflow;
	}

	public void setWorkflow(String workflow) {
		this.workflow = workflow;
	}

	public List<String> getParams() {
		return params;
	}

	public void setParams(List<String> params) {
		this.params = params;
	}
	
	
}
